﻿#region Namespace References

using System;
using DynConDevCorp.OpenArch.SmartData.Interfaces.EventArgClasses;

#endregion

namespace DynConDevCorp.OpenArch.SmartData.Interfaces
{
    public interface ISmartNullableField : ISmartField
    {
        
    }

    public interface ISmartNullableField<TData> : ISmartNullableField
        where TData : struct, IComparable<TData>
    {
        #region Public Instance Properties

        /// <summary>
        /// Gets or sets the display formatter.
        /// </summary>
        /// <value>The display formatter.</value>
        ISmartDisplayFormatter<TData> DisplayFormatter { get; set; }

        /// <summary>
        /// Gets or sets the input parser.
        /// </summary>
        /// <value>The input parser.</value>
        ISmartInputParser<TData?> InputParser { get; set; }

        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        /// <value>The value.</value>
        TData? Value { get; set; }

        #endregion

        #region Public Instance Methods

        /// <summary>
        /// Adds the effect.
        /// </summary>
        /// <param name="effect">The effect.</param>
        void AddEffect(ISmartEffect<TData?> effect);


        /// <summary>
        /// Adds the rule.
        /// </summary>
        /// <param name="rule">The rule.</param>
        void AddRule(ISmartRule<TData?> rule);

        /// <summary>
        /// Removes the effect.
        /// </summary>
        /// <param name="effect">The effect.</param>
        void RemoveEffect(ISmartEffect<TData?> effect);

        /// <summary>
        /// Removes the rule.
        /// </summary>
        /// <param name="rule">The rule.</param>
        void RemoveRule(ISmartRule<TData?> rule);

        #endregion

        #region All Other Members

        /// <summary>
        /// Occurs when [value changed].
        /// </summary>
        event EventHandler<ValueChangedEventArgs<TData?>> ValueChanged;

        #endregion
    }
}